package com.ls.uav_backend.controller;

import com.ls.uav_backend.common.BaseResponse;
import com.ls.uav_backend.common.ResultUtils;
import com.ls.uav_backend.model.vo.environmental.*;
import com.ls.uav_backend.service.EnvironmentalDataService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *  控制层。
 *
 * @author <a href="https://gitee.com/Linkating">LinSkating</a>
 */
@RestController
@RequestMapping("/environmentalData")
public class EnvironmentalDataController {

    @Resource
    private EnvironmentalDataService environmentalDataService;

    @GetMapping("/getInAndOutTemperatureData")
    public BaseResponse<InAndOutTemperatureVO> getInAndOutTemperatureData() {
        return ResultUtils.success(environmentalDataService.getInAndOutTemperatureData());
    }

    @GetMapping("/getIlluminationData")
    public BaseResponse<IlluminationVO> getIlluminationData() {
        return ResultUtils.success(environmentalDataService.getIlluminationData());
    }

    @GetMapping("/getWaterContentData")
    public BaseResponse<WaterContentVO> getWaterContentData() {
        return ResultUtils.success(environmentalDataService.getWaterContentData());
    }

    @GetMapping("/getSoilData")
    public BaseResponse<SoilVO> getSoilData() {
        return ResultUtils.success(environmentalDataService.getSoilData());
    }

    @GetMapping("/getSensorData")
    public BaseResponse<SensorDataVO> getSensorData() {
        return ResultUtils.success(environmentalDataService.getSensorData());
    }
}
